package com.situ.mall.common.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.situ.mall.common.entity.Member;
import com.situ.mall.common.entity.MemberAddress;
import com.situ.mall.common.mapper.MemberAddressMapper;
import com.situ.mall.common.service.IMemberAddressService;
import com.situ.mall.common.util.RequestUtil;

import com.situ.mall.common.vo.AddressVO;
import com.situ.mall.common.vo.MemberAddressVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lwj
 * @since 2023-09-18
 */
@Service
public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, MemberAddress> implements IMemberAddressService {

    @Override
    public List<AddressVO> select(Integer mId) {
        List<AddressVO> list= baseMapper.select(mId);

        return list;
    }

    @Override
    public MemberAddressVO checkAddress(Integer id) {
        Member m = (Member) RequestUtil.getCurrent();
        return baseMapper.cheakAddress(id,m.getId());
    }

    @Override
    public void deleteAddress(Integer id) {
        baseMapper.deleteById(id);
    }


}
